#include <REGX52.H>


void Delay(unsigned int xms)     //@11.0592MHz
{
    unsigned char i, j;

    while (xms--)
    {
        i = 2;
        j = 199;
        do
        {
            while (--j);
        }
        while (--i);
    }
}

sbit sign0 = P1 ^ 0;
sbit sign1 = P1 ^ 1;

sbit led1 = P3 ^ 7;
sbit led2 = P3 ^ 6;


void main()
{
    
    while (1)
    {
        led2 = sign1 == 0 ? 0 : 1;
        
        if(sign1 == 0){
            led1 = 0;
            Delay(2000);
        }else{
            led1 = 1;
        }
        
    }
}